# Create your views here.
from translate.forms import *


from django.http import HttpResponse
from django.template import RequestContext
from django.shortcuts import render_to_response 
from django.http import HttpResponseRedirect


import monty_process
import string
import unicodedata


def main_page(request):



    output_sentences = []
    output_tags = []

    if request.method == 'POST':
        form = InputForm(request.POST)
        if form.is_valid():
            inputtext=form.cleaned_data['inputtext']
            
            [output_sentences, output_tags] = monty_process.process_text(inputtext)
            
    else:
        form = InputForm()

    variables = RequestContext(request, {
            'form': form,
            'output_sentences':  output_sentences,
            'output_tags':  output_tags,
            })
    return render_to_response( 'main_page.html', variables)

